package cn.gdsdxy.dao;
import cn.gdsdxy.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
public interface StudentDao {
    @Select("select * from t_student")
    public List<Student> getAllStudent();

    @Select("select * from t_student")
    public List<Student>getAStudent();

    @Select("select * from t_student where number=#{number} and name=#{name}")
    public List<Student> getStudentByNumberAndName(@Param("number") int number,@Param("name") String name);

    @Insert("insert into t_student (number,name,sex) values(#{number},#{name},#{sex})")
    public int addStudent(Student student);

    @Delete("delete from  t_student where number=#{number}")
    public int deleteStudent(int number);

    @Update("update t_student set name=#{name},sex=#{sex} where number = #{number}")
    public int updataStudent(Student student);
}
